/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */
package model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.*;
import javax.persistence.Table;
import javax.persistence.Entity;
import org.hibernate.ejb.HibernateQuery;

/**
 *
 * @author Marvin Hiemstra
 */
@Entity
@Table(name="Category")
public class Category implements Serializable{
    @Id
    @Column(name = "category_name")
    private String categoryName;
    @Column(name = "category_description")
    private String categoryDescription;
    
    
    public Category(){   
    }
    
    public Category(String categoryName) {
        if (categoryName== null) {
            throw new NullPointerException("Category name may not be empty");
	}
        this.categoryName = categoryName;
    }
    
    public Category(String categoryName, String categoryDescription) {
        if (categoryName== null) {
            throw new NullPointerException("Category name may not be empty");
	}	
        if (categoryDescription == null) {
            throw new NullPointerException("Description may not be empty");
        }
        
        this.categoryName = categoryName;
        this.setCategoryDescription(categoryDescription);
    }

    

    public String getCategoryDescription() {
        return categoryDescription;
    }

    public void setCategoryDescription(String categoryDescription) {
        this.categoryDescription = categoryDescription;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }
    
}
